package com.cx330;

import org.junit.Test;

import java.util.HashMap;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.TreeMap;

public class Example65 {
    @Test
    public void test1() {
        HashMap<Integer, String> map = new HashMap<>();
        map.put(111, "hello");
        map.put(888, "java");
        map.put(666, "Cx330");
        map.put(null, null);
        System.out.println(map);
    }

    @Test
    public void test2() {
        LinkedHashMap<Integer, String> map = new LinkedHashMap<>();
        map.put(111, "hello");
        map.put(888, "java");
        map.put(666, "Cx330");
        map.put(null, null);
        System.out.println(map);
    }

    @Test
    public void test3() {
        TreeMap<Integer, String> map = new TreeMap<>();;
        map.put(111, "hello");
        map.put(888, "java");
        map.put(666, "Cx330");
//        map.put(null, null);
        System.out.println(map);
    }

    @Test
    public void test4() {
        Hashtable<Integer, String> map = new Hashtable<>();
        map.put(111, "hello");
        map.put(888, "java");
        map.put(666, "Cx330");
//        map.put(null, null);
        System.out.println(map);
    }
}
